<?php

$con = mysql_connect("localhost","root","");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
 
mysql_select_db("player_profile", $con);
$id = $_GET['id'];
$select = sprintf("Select * from players where id='%s' ", mysql_real_escape_string($id));
$result = mysql_query($select);


$select = sprintf("Select * from awards where player_id='%s' ", mysql_real_escape_string($id));
$awards = mysql_query($select);
$r = mysql_fetch_assoc($result);
$aw = null;
while($a = mysql_fetch_assoc($awards)){
	$aw[] = $a;
}
if($awards){
	$r['awards'] = $aw;
}
echo json_encode($r);

?>